45 FrameBaseWPtr frame_ptr_;
46 FeatureBasePtrList feature_list_;
47 SensorBaseWPtr sensor_ptr_;
49 static unsigned int capture_id_count_;
54 void setProblem(ProblemPtr _problem)
override final;
74 SensorBasePtr _sensor_ptr =
nullptr,
85 void remove(
bool viral_remove_parent_without_children =
false)
override;
100 virtual FactorBasePtr
emplaceDriftFactor(CaptureBasePtr _capture_origin,
char _key,
bool _apply_loss_function);
115 unsigned int id()
const override;
124 void setFrame(
const FrameBasePtr _frm_ptr);
129 bool hasFeature(
const FeatureBaseConstPtr& _feature)
const;
138 virtual void setSensor(
const SensorBasePtr sensor_ptr);
142 StateBlockConstPtr
getStateBlock(
const char& _key)
const override;
152 void unfix()
override;
158 void link(FrameBasePtr _frm_ptr);
166 template <
typename classType,
typename... T>
167 static std::shared_ptr<classType>
emplace(FrameBasePtr _frm_ptr, T&&... all);
182 std::ostream& stream,
183 std::string _tabs =
"")
const;
194 void print(
int depth,
198 std::ostream& stream = std::cout,
199 std::string _tabs =
"")
const;
208 virtual CheckLog localCheck(
bool _verbose, std::ostream& _stream, std::string _tabs =
"")
const;
218 bool check(
CheckLog& _log,
bool _verbose, std::ostream& _stream, std::string _tabs =
"")
const;
221 FeatureBasePtr addFeature(FeatureBasePtr _ft_ptr);
222 void removeFeature(FeatureBasePtr _ft_ptr);
243template <
typename classType,
typename... T>
246 std::shared_ptr<classType> cpt = std::make_shared<classType>(std::forward<T>(all)...);
247 cpt->emplacePriors();
289 if (frame_ptr_.expired())
292 return frame_ptr_.lock();
297 if (frame_ptr_.expired())
300 return frame_ptr_.lock();
303inline void CaptureBase::setFrame(
const FrameBasePtr _frm_ptr)
305 frame_ptr_ = _frm_ptr;
310 FeatureBaseConstPtrList list_const;
311 for (
auto&& obj_ptr : feature_list_) list_const.push_back(obj_ptr);
317 return feature_list_;
327 return sensor_ptr_.lock();
332 return sensor_ptr_.lock();
337 sensor_ptr_ = sensor_ptr;
352 return std::static_pointer_cast<CaptureBase>(shared_from_this());
357 return std::static_pointer_cast<const CaptureBase>(shared_from_this());
Definition: capture_base.h:39
virtual void printHeader(int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream, std::string _tabs="") const
Print the header information of the capture.
Definition: capture_base.cpp:268
bool process()
Process the capture.
Definition: capture_base.cpp:151
StateBlockConstPtr getSensorO() const
Definition: capture_base.h:262
unsigned int id() const override
Definition: capture_base.h:282
TimeStamp time_stamp_
Time stamp.
Definition: capture_base.h:53
StateBlockConstPtr getSensorP() const
Definition: capture_base.h:252
void fix() override
Definition: capture_base.cpp:227
void print(int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream=std::cout, std::string _tabs="") const
Print the capture details.
Definition: capture_base.cpp:296
FrameBaseConstPtr getFrame() const
Definition: capture_base.h:287
StateBlockConstPtr getStateBlock(const char &_key) const override
Definition: capture_base.cpp:201
FeatureBaseConstPtrList getFeatureList() const
Definition: capture_base.h:308
unsigned int capture_id_
Definition: capture_base.h:52
CaptureBase(const std::string &_type, const TimeStamp &_ts, SensorBasePtr _sensor_ptr=nullptr, const TypeComposite &_state_types={}, const VectorComposite &_state_vectors={}, const PriorComposite &_state_priors={})
Constructor.
Definition: capture_base.cpp:29
SensorBaseConstPtr getSensor() const
Definition: capture_base.h:325
void setTimeStamp(const TimeStamp &_ts)
Definition: capture_base.h:340
bool hasChildren() const override
Check if the capture has any children.
Definition: capture_base.cpp:109
void setProblem(ProblemPtr _problem) override final
Definition: capture_base.cpp:252
FactorBaseConstPtrList getFactorList() const
Definition: capture_base.cpp:170
virtual FactorBasePtr emplaceDriftFactor(CaptureBasePtr _capture_origin, char _key, bool _apply_loss_function)
Emplace a FactorBlockDifference with zero difference between the state _key of this capture and _capt...
Definition: capture_base.cpp:114
virtual void setSensor(const SensorBasePtr sensor_ptr)
Definition: capture_base.h:335
void unfix() override
Definition: capture_base.cpp:232
StateBlockConstPtr getSensorIntrinsic() const
Definition: capture_base.h:272
virtual bool isMotion() const
Is a motion if there is motion detected.
Definition: capture_base.h:238
void link(FrameBasePtr _frm_ptr)
Link the capture to a frame.
Definition: capture_base.cpp:237
~CaptureBase() override=default
void remove(bool viral_remove_parent_without_children=false) override
Remove the capture.
Definition: capture_base.cpp:73
bool check(CheckLog &_log, bool _verbose, std::ostream &_stream, std::string _tabs="") const
Check the capture.
Definition: capture_base.cpp:378
CaptureBasePtr shared_from_this_capture()
Definition: capture_base.h:350
void setTimeStampToNow()
Definition: capture_base.h:345
TimeStamp getTimeStamp() const
Definition: capture_base.h:320
bool hasFeature(const FeatureBaseConstPtr &_feature) const
Definition: capture_base.cpp:196
virtual CheckLog localCheck(bool _verbose, std::ostream &_stream, std::string _tabs="") const
Perform a local check on the capture.
Definition: capture_base.cpp:309
static std::shared_ptr< classType > emplace(FrameBasePtr _frm_ptr, T &&... all)
Emplace a new capture of type classType.
Definition: capture_base.h:244
Definition: check_log.h:28
Definition: factor_base.h:72
Definition: feature_base.h:38
Definition: frame_base.h:38
Definition: node_state_blocks.h:32
TimeStamp implements basic functionalities for time stamps.
Definition: time_stamp.h:39
void setToNow()
Time stamp to now.
Definition: time_stamp.cpp:69
Definition: vector_composite.h:27
Definition: capture_base.h:23
Composite< Prior > PriorComposite
Definition: prior_composite.h:56